<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Using GTK+ with Broadway: GTK+ 3 Reference Manual</title>
<meta name="generator" content="DocBook XSL Stylesheets Vsnapshot">
<link rel="home" href="index.html" title="GTK+ 3 Reference Manual">
<link rel="up" href="platform-support.html" title="Part VII. GTK+ Platform Support">
<link rel="prev" href="gtk-osx.html" title="Using GTK+ on Mac OS X">
<link rel="next" href="gtk-wayland.html" title="Using GTK+ with Wayland">
<meta name="generator" content="GTK-Doc V1.33.1 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle">
<td width="100%" align="left" class="shortcuts"></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td>
<td><a accesskey="u" href="platform-support.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td>
<td><a accesskey="p" href="gtk-osx.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td>
<td><a accesskey="n" href="gtk-wayland.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td>
</tr></table>
<div class="refentry">
<a name="gtk-broadway"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle">Using GTK+ with Broadway</span></h2>
<p>Using GTK+ with Broadway — 
HTML-specific aspects of using GTK+
</p>
</td>
<td class="gallery_image" valign="top" align="right"></td>
</tr></table></div>
<div class="refsect1">
<a name="id-1.8.8.3"></a><h2>Using GTK+ with Broadway</h2>
<p>
The GDK Broadway backend provides support for displaying GTK+
applications in a web browser, using HTML5 and web sockets. To run
your application in this way, select the Broadway backend by setting
<code class="literal">GDK_BACKEND=broadway</code>. Then you can make
your application appear in a web browser by pointing it at
<code class="literal">http://127.0.0.1:8080</code>. Note that you need
to enable web sockets in your web browser.
</p>
<p>
You can choose a different port from the default 8080 by setting
the <code class="envar">BROADWAY_DISPLAY</code> environment variable to the
port that you want to use.
</p>
<p>
It is also possible to use multiple GTK+ applications in the same
web browser window, by using the Broadway server,
<span class="command"><strong>broadwayd</strong></span>, that ships with GTK+.
To use broadwayd, start it like this:
</p>
<pre class="programlisting">
broadwayd :5
</pre>
<p>
Then point your web browser at <code class="literal">http://127.0.0.1:8085</code>.
Start your applications like this:
</p>
<pre class="programlisting">
GDK_BACKEND=broadway BROADWAY_DISPLAY=:5 gtk3-demo
</pre>
<p>
</p>
<div class="refsect2">
<a name="broadway-envar"></a><h3>Broadway-specific environment variables</h3>
</div>
<p><b><code class="envar">BROADWAY_DISPLAY</code>. </b>
      Specifies the Broadway display number. The default display is 0.
      The display number determines the port to use when connecting
      to a Broadway application via the following formula:
      </p>
<pre class="programlisting">
        <em class="replaceable"><code>port</code></em> = 8080 + <em class="replaceable"><code>display</code></em>
      </pre>
<p>
    </p>
</div>
</div>
<div class="footer">
<hr>Generated by GTK-Doc V1.33.1</div>
</body>
</html>